/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package se.sll.engagemangsindex.ws;

import javax.inject.Inject;
import javax.jws.WebService;
import riv.itintegration.registry.getlogicaladdresseesbyservicecontract._1.rivtabp21.GetLogicalAddresseesByServiceContractResponderInterface;
import riv.itintegration.registry.getlogicaladdresseesbyservicecontractresponder._1.GetLogicalAddresseesByServiceContractResponseType;
import riv.itintegration.registry.getlogicaladdresseesbyservicecontractresponder._1.GetLogicalAddresseesByServiceContractType;
import se.sll.engagemangsindex.ejb.LogicalAddressCache;

/**
 *
 * @author khaleddaham
 */
@WebService(endpointInterface = "riv.itintegration.registry.getlogicaladdresseesbyservicecontract._1.rivtabp21.GetLogicalAddresseesByServiceContractResponderInterface",
serviceName = "GetLogicalAddresseesByServiceContract")
public class GetLogicalAddresseesByServiceContractWSImpl implements GetLogicalAddresseesByServiceContractResponderInterface {

    @Inject
    private LogicalAddressCache logicalAddressCache;

    @Override
    public GetLogicalAddresseesByServiceContractResponseType getLogicalAddresseesByServiceContract(String logicalAddress, GetLogicalAddresseesByServiceContractType parameters) {
        GetLogicalAddresseesByServiceContractResponseType response = new GetLogicalAddresseesByServiceContractResponseType();
        for (String addr : logicalAddressCache.getLogicalAddresses()) {
            response.getLogicalAddress().add(addr);
        }
        return response;
    }
}